{% extends 'base.html' %}
{% block title %}
报告
{% endblock %}
{% block content %}
<div class="btn-group">
    <button type="button" class="btn btn-info">{{ product.name }}</button>
    <button type="button" class="btn btn-primary dropdown-toggle btn-sm" data-toggle="dropdown">
        <span class="caret"></span>
        <span class="sr-only">切换下拉菜单</span>
    </button>
    <ul class="dropdown-menu" role="menu">
        {% for pd in products %}
        <li><a href="{{ url_for('wx.bp_report.bug',pk=pd.id) }}">{{ pd.name }}</a></li>
        {% endfor %}
    </ul>
</div>
<br>
<br>
<h5>问题列表</h5>
<br>
<div class="row">
    <div class="col-sm-12">
        <div class="table-responsive">
            <table class="table table-bordered table-striped table-sm">
                <thead>
                    <tr>
                        <th>BUG_ID</th>
                        <th>用例名称</th>
                        <th>步骤名称</th>
                        <th>数据详情</th>
                        <th>BUG详情</th>
                        <th>BUG状态</th>
                        <th>BUG等级</th>
                        <th>更新时间</th>
                        <th>任务ID</th>
                    </tr>
                </thead>
                <tbody>
                    {% if bugs %}
                    {% for bug in bugs %}
                    <tr>
                        <td><strong class="text-info">{{ bug.id }}</strong></td>
                        <td><strong>{{ bug.casename }}</strong></td>
                        <td><strong>{{ bug.stepname }}</strong></td>
                        <td><small class="text-muted">{{ bug.request }}</small></td>
                        <td><small class="text-muted">{{ bug.detail }}</small></td>
                        {% if bug.status == 1 %}
                        <td><span class="badge badge-success">已解决</span></td>
                        {% elif bug.status == 0 %}
                        <td><span class="badge badge-danger">未解决</span></td>
                        {% endif %}
                        {% if bug.level == "建议" %}
                        <td class="text-info">{{ bug.level }}</td>
                        {% elif bug.level == "一般" %}
                        <td class="text-warning">{{ bug.level }}</td>
                        {% elif bug.level == "严重" %}
                        <td class="text-danger">{{ bug.level }}</td>
                        {% elif bug.level == "致命" %}
                        <td class="bg-danger text-white">{{ bug.level }}</td>
                        {% endif %}
                        <td>{{ moment(bug.updated).format('lll') }}</td>
                        <td><small class="text-muted">{{ bug.task_id }}</small></td>
                    </tr>
                    {% endfor %}
                    {% else %}
                    <p style="color: red">暂无数据</p>
                    {% endif %}

                </tbody>
            </table>
        </div>
    </div>
</div>
{% endblock %}